package cn.iocoder.yudao.module.common.dal.mysql.knowledgepointrelation;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.common.dal.dataobject.knowledgepointrelation.KnowledgePointRelationDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.common.controller.admin.knowledgepointrelation.vo.*;

/**
 * 知识关系点 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface KnowledgePointRelationMapper extends BaseMapperX<KnowledgePointRelationDO> {

    default PageResult<KnowledgePointRelationDO> selectPage(KnowledgePointRelationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<KnowledgePointRelationDO>()
                .eqIfPresent(KnowledgePointRelationDO::getEntityId, reqVO.getEntityId())
                .eqIfPresent(KnowledgePointRelationDO::getEntityType, reqVO.getEntityType())
                .eqIfPresent(KnowledgePointRelationDO::getPointId, reqVO.getPointId())
                .likeIfPresent(KnowledgePointRelationDO::getCreatorName, reqVO.getCreatorName())
                .betweenIfPresent(KnowledgePointRelationDO::getCreateTime, reqVO.getCreateTime())
                .likeIfPresent(KnowledgePointRelationDO::getUpdaterName, reqVO.getUpdaterName())
                .eqIfPresent(KnowledgePointRelationDO::getVersion, reqVO.getVersion())
                .orderByDesc(KnowledgePointRelationDO::getId));
    }

}